/**
 */
package gatperdut.chato.model.Chato.Craft.impl;

import gatperdut.chato.model.Chato.Constant.CraftImplementLocation;
import gatperdut.chato.model.Chato.Craft.CraftPackage;
import gatperdut.chato.model.Chato.Craft.CraftTool;
import gatperdut.chato.model.Chato.Item.ItemTemplate;
import java.util.Collection;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Tool</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftToolImpl#getOrList <em>Or List</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftToolImpl#isReusable <em>Reusable</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftToolImpl#getLocation <em>Location</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CraftToolImpl extends CDOObjectImpl implements CraftTool {
	/**
     * The default value of the '{@link #isReusable() <em>Reusable</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #isReusable()
     * @generated
     * @ordered
     */
	protected static final boolean REUSABLE_EDEFAULT = false;

	/**
     * The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getLocation()
     * @generated
     * @ordered
     */
	protected static final CraftImplementLocation LOCATION_EDEFAULT = CraftImplementLocation.ANYWHERE;

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected CraftToolImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return CraftPackage.Literals.CRAFT_TOOL;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected int eStaticFeatureCount() {
        return 0;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	public EList<ItemTemplate> getOrList() {
        return (EList<ItemTemplate>)eDynamicGet(CraftPackage.CRAFT_TOOL__OR_LIST, CraftPackage.Literals.CRAFT_TOOL__OR_LIST, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public boolean isReusable() {
        return (Boolean)eDynamicGet(CraftPackage.CRAFT_TOOL__REUSABLE, CraftPackage.Literals.CRAFT_TOOL__REUSABLE, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setReusable(boolean newReusable) {
        eDynamicSet(CraftPackage.CRAFT_TOOL__REUSABLE, CraftPackage.Literals.CRAFT_TOOL__REUSABLE, newReusable);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public CraftImplementLocation getLocation() {
        return (CraftImplementLocation)eDynamicGet(CraftPackage.CRAFT_TOOL__LOCATION, CraftPackage.Literals.CRAFT_TOOL__LOCATION, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setLocation(CraftImplementLocation newLocation) {
        eDynamicSet(CraftPackage.CRAFT_TOOL__LOCATION, CraftPackage.Literals.CRAFT_TOOL__LOCATION, newLocation);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case CraftPackage.CRAFT_TOOL__OR_LIST:
                return getOrList();
            case CraftPackage.CRAFT_TOOL__REUSABLE:
                return isReusable();
            case CraftPackage.CRAFT_TOOL__LOCATION:
                return getLocation();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case CraftPackage.CRAFT_TOOL__OR_LIST:
                getOrList().clear();
                getOrList().addAll((Collection<? extends ItemTemplate>)newValue);
                return;
            case CraftPackage.CRAFT_TOOL__REUSABLE:
                setReusable((Boolean)newValue);
                return;
            case CraftPackage.CRAFT_TOOL__LOCATION:
                setLocation((CraftImplementLocation)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case CraftPackage.CRAFT_TOOL__OR_LIST:
                getOrList().clear();
                return;
            case CraftPackage.CRAFT_TOOL__REUSABLE:
                setReusable(REUSABLE_EDEFAULT);
                return;
            case CraftPackage.CRAFT_TOOL__LOCATION:
                setLocation(LOCATION_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case CraftPackage.CRAFT_TOOL__OR_LIST:
                return !getOrList().isEmpty();
            case CraftPackage.CRAFT_TOOL__REUSABLE:
                return isReusable() != REUSABLE_EDEFAULT;
            case CraftPackage.CRAFT_TOOL__LOCATION:
                return getLocation() != LOCATION_EDEFAULT;
        }
        return super.eIsSet(featureID);
    }

} //CraftToolImpl
